/**
 * Copyright &copy; 2012-2016 <a href="https://istep.lczyfz.com">Istep</a> All rights reserved.
 */
package com.lczyfz.istep.modules.scene.dao;

import com.lczyfz.istep.common.persistence.CrudDao;
import com.lczyfz.istep.common.persistence.annotation.MyBatisDao;
import com.lczyfz.istep.modules.scene.entity.SceneEnvironmentInstance;
import com.lczyfz.istep.modules.scene.entity.SceneEnvironmentInstanceOs;
import com.lczyfz.istep.modules.sys.entity.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 教学实验环境实例DAO接口
 * @author dh
 * @version 2017-04-11
 */
@MyBatisDao
public interface SceneEnvironmentInstanceDao extends CrudDao<SceneEnvironmentInstance> {
    void  envInstanceRouterInsert (SceneEnvironmentInstanceOs sceneEnvironmentInstanceOs);
    void  envInstanceNetworkInsert (SceneEnvironmentInstanceOs sceneEnvironmentInstanceOs);
    void  envInstanceSecurityGroupInsert (SceneEnvironmentInstanceOs sceneEnvironmentInstanceOs);
    void  envInstanceVmTemplateInsert (SceneEnvironmentInstanceOs sceneEnvironmentInstanceOs);
    void  envInstancePortInsert (SceneEnvironmentInstanceOs sceneEnvironmentInstanceOs);
    void  envInstanceFirewallInsert(SceneEnvironmentInstanceOs sceneEnvironmentInstanceOs);
    void  envInstanceFirewallRuleInsert(SceneEnvironmentInstanceOs sceneEnvironmentInstanceOs);

    List<SceneEnvironmentInstanceOs> findFirewallListByInstanceId(SceneEnvironmentInstance sceneEnvironmentInstance);
    List<SceneEnvironmentInstanceOs> findFirewallRuleListByInstanceId(SceneEnvironmentInstance sceneEnvironmentInstance);
    List<SceneEnvironmentInstanceOs> findNetworkListByInstanceId(SceneEnvironmentInstance sceneEnvironmentInstance);
    List<SceneEnvironmentInstanceOs> findPortListByInstanceId(SceneEnvironmentInstance sceneEnvironmentInstance);
    List<SceneEnvironmentInstanceOs> findRouterListByInstanceId(SceneEnvironmentInstance sceneEnvironmentInstance);
    List<SceneEnvironmentInstanceOs> findSecurityGroupListByInstanceId(SceneEnvironmentInstance sceneEnvironmentInstance);
    List<SceneEnvironmentInstanceOs> findVmTemplateListByInstanceId(SceneEnvironmentInstance sceneEnvironmentInstance);
    List<SceneEnvironmentInstanceOs> findOperateMachineByInstanceId(SceneEnvironmentInstance sceneEnvironmentInstance);

    List<SceneEnvironmentInstanceOs> findPortListById(@Param("id")String id,@Param("environmentInstanceId")String environmentInstanceId);

    void deleteInstanceFirewall(SceneEnvironmentInstance sceneEnvironmentInstance);
    void deleteInstanceFirewallRule(SceneEnvironmentInstance sceneEnvironmentInstance);
    void deleteInstanceRouter(SceneEnvironmentInstance sceneEnvironmentInstance);
    void deleteInstanceNetwork(SceneEnvironmentInstance sceneEnvironmentInstance);
    void deleteInstancePort(SceneEnvironmentInstance sceneEnvironmentInstance);
    void deleteInstanceSecurityGroup(SceneEnvironmentInstance sceneEnvironmentInstance);
    void deleteInstanceVmTemplate(SceneEnvironmentInstance sceneEnvironmentInstance);

    void instanceVmUpdate(String consoleUrl,String vmTemplateId);


    //根据用户查找实例
    List<SceneEnvironmentInstance> getInstanceByUser(User user);
    SceneEnvironmentInstanceOs getInstanceVm(@Param("vmId")String vmId);
}